import requests
from lxml import etree


url = 'https://beijing.zbj.com/search/f/?type=new&kw=saas'
resp = requests.get(url=url)
resp.encoding = 'utf-8'
# print(resp.text)

print('-------------------- html 字符串用 etree.HTML() --------------------')
html = etree.HTML(resp.text)
divs = html.xpath('/html/body/div[2]/div/div/div[3]/div/div[4]/div/div[2]/div[1]/div')
divs = html.xpath('//*[@id="__layout"]/div/div[3]/div/div[4]/div/div[2]/div[1]/div')
for div in divs:
    print("-----------------")
    price = div.xpath('./div/div[2]/div[1]/span/text()')
    name = div.xpath('./div/div[2]/div[2]/a/text()')
    print(price, name)